****Making a Connection 2008
****Michele Claibourn
****Data Analysis
****Initially run in Stata 9 and Stata 10

**This file begins with the procssed data file 
**And estimates models from Tables 1-4

cd "/Users/mclaibourn/Box Sync/mpc/Politics/research/2000ads/replicationJOP"
use "survey_ads_2000v2.dta", clear

*Run hetreg first time only
*do "hetreg.sta"

*Estimate models
*FT function of centerd issue priority, issue priority*logged ad count, priority*count*pid7, logged ad count, priority*pid7, and rest

*Education
*Gore - logged accumulated count
ml model lf hetreg (Slopes:ftgore=ceducp edxlged p7xexge lgeduc p7xlged p7xeducp pid7 ideology econp educ aware female age minority) (Variance: educ lgeduc)
ml max
estimates store educgacc
*Gore - logged 7 day count
ml model lf hetreg (Slopes:ftgore=ceducp edxlg7ed p7xexg7e lg7educ p7xlg7ed p7xeducp pid7 ideology econp educ aware female age minority) (Variance: educ lg7educ)
ml max
*Gore - logged 3 day count
ml model lf hetreg (Slopes:ftgore=ceducp edxlg3ed p7xexg3e lg3educ p7xlg3ed p7xeducp pid7 ideology econp educ aware female age minority) (Variance: educ lg3educ)
ml max
estimates store educg3d

*Education
*Bush - logged accumulated count
ml model lf hetreg (Slopes:ftbush=ceducp edxlbed p7xexbe lbeduc p7xlbed p7xeducp pid7 ideology econp educ aware female age minority) (Variance: educ lbeduc)
ml max
estimates store educbacc
*Bush - logged 7 day count
ml model lf hetreg (Slopes:ftbush=ceducp edxlb7ed p7xexb7e lb7educ p7xlb7ed p7xeducp pid7 ideology econp educ aware female age minority) (Variance: educ lb7educ)
ml max
*Bush - logged 3 day count
ml model lf hetreg (Slopes:ftbush=ceducp edxlb3ed p7xexb3e lb3educ p7xlb3ed p7xeducp pid7 ideology econp educ aware female age minority) (Variance: educ lb3educ)
ml max
estimates store educb3d


*Health care
*Gore - logged accumulated count
ml model lf hetreg (Slopes:ftgore=chlthp hlxlghl p7xhxgh lghlth p7xlghl p7xhlthp pid7 ideology econp educ aware female age minority) (Variance: educ lghlth)
ml max
estimates store hlthgacc
*Gore - logged 7 day count
ml model lf hetreg (Slopes:ftgore=chlthp hlxlg7hl p7xhxg7h lg7hlth p7xlg7hl p7xhlthp pid7 ideology econp educ aware female age minority) (Variance: educ lg7hlth)
ml max
*Gore - logged 3 day count
ml model lf hetreg (Slopes:ftgore=chlthp hlxlg3hl p7xhxg3h lg3hlth p7xlg3hl p7xhlthp pid7 ideology econp educ aware female age minority) (Variance: educ lg3hlth)
ml max
estimates store hlthg3d

*Health care
*Bush - logged accumulated count
ml model lf hetreg (Slopes:ftbush=chlthp hlxlbhl p7xhxbh lbhlth p7xlbhl p7xhlthp pid7 ideology econp educ aware female age minority) (Variance: educ lbhlth)
ml max
estimates store hlthbacc
*Bush - logged 7 day count
ml model lf hetreg (Slopes:ftbush=chlthp hlxlb7hl p7xhxb7h lb7hlth p7xlb7hl p7xhlthp pid7 ideology econp educ aware female age minority) (Variance: educ lb7hlth)
ml max
*Bush - logged 3 day count
ml model lf hetreg (Slopes:ftbush=chlthp hlxlb3hl p7xhxb3h lb3hlth p7xlb3hl p7xhlthp pid7 ideology econp educ aware female age minority) (Variance: educ lb3hlth)
ml max
estimates store hlthb3d


*Social security
*Gore - logged accumulated count
ml model lf hetreg (Slopes:ftgore=cssecp ssxlgss p7xsxgs lgssec p7xlgss p7xssecp pid7 ideology econp educ aware female age minority) (Variance: educ lgssec)
ml max
estimates store ssecgacc
*Gore - logged 7 day count
ml model lf hetreg (Slopes:ftgore=cssecp ssxlg7ss p7xsxg7s lg7ssec p7xlg7ss p7xssecp pid7 ideology econp educ aware female age minority) (Variance: educ lg7ssec)
ml max
*Gore - logged 3 day count
ml model lf hetreg (Slopes:ftgore=cssecp ssxlg3ss p7xsxg3s lg3ssec p7xlg3ss p7xssecp pid7 ideology econp educ aware female age minority) (Variance: educ lg3ssec)
ml max
estimates store ssecg3d

*Social security
*Bush - logged accumulated count
ml model lf hetreg (Slopes:ftbush=cssecp ssxlbss p7xsxbs lbssec p7xlbss p7xssecp pid7 ideology econp educ aware female age minority) (Variance: educ lbssec)
ml max
estimates store ssecbacc
*Bush - logged 7 day count
ml model lf hetreg (Slopes:ftbush=cssecp ssxlb7ss p7xsxb7s lb7ssec p7xlb7ss p7xssecp pid7 ideology econp educ aware female age minority) (Variance: educ lb7ssec)
ml max
*Bush - logged 3 day count
ml model lf hetreg (Slopes:ftbush=cssecp ssxlb3ss p7xsxb3s lb3ssec p7xlb3ss p7xssecp pid7 ideology econp educ aware female age minority) (Variance: educ lb3ssec)
ml max
estimates store ssecb3d


*Taxes
*Gore - logged accumulated count
ml model lf hetreg (Slopes:ftgore=ctaxp txxlgtx p7xtxgt lgtax p7xlgtx p7xtaxp pid7 ideology econp educ aware female age minority) (Variance: educ lgtax)
ml max
estimates store taxgacc
*Gore - logged 7 day count
ml model lf hetreg (Slopes:ftgore=ctaxp txxlg7tx p7xtxg7t lg7tax p7xlg7tx p7xtaxp pid7 ideology econp educ aware female age minority) (Variance: educ lg7tax)
ml max
*Gore - logged 3 day count
ml model lf hetreg (Slopes:ftgore=ctaxp txxlg3tx p7xtxg3t lg3tax p7xlg3tx p7xtaxp pid7 ideology econp educ aware female age minority) (Variance: educ lg3tax)
ml max
estimates store taxg3d

*Taxes
*Bush - logged accumulated count
ml model lf hetreg (Slopes:ftbush=ctaxp txxlbtx p7xtxbt lbtax p7xlbtx p7xtaxp pid7 ideology econp educ aware female age minority) (Variance: educ lbtax)
ml max
estimates store taxbacc
*Bush - logged 7 day count
ml model lf hetreg (Slopes:ftbush=ctaxp txxlb7tx p7xtxb7t lb7tax p7xlb7tx p7xtaxp pid7 ideology econp educ aware female age minority) (Variance: educ lb7tax)
ml max
*Bush - logged 3 day count
ml model lf hetreg (Slopes:ftbush=ctaxp txxlb3tx p7xtxb3t lb3tax p7xlb3tx p7xtaxp pid7 ideology econp educ aware female age minority) (Variance: educ lb3tax)
ml max
estimates store taxb3d

*Retrieve AIC and BIC
estimates stats

